package cn.yunyichina.provider.reservation.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.yunyichina.provider.iface.entity.common.Response;
import cn.yunyichina.provider.reservation.dao.CityDao;
import cn.yunyichina.provider.reservation.entity.City;
import cn.yunyichina.provider.reservation.service.CityService;

import com.alibaba.fastjson.JSON;

/**
 * Created by Lullaby on 2016/8/24.
 */
@Service
public class CityServiceImpl implements CityService {

    @Resource
    private CityDao cityDao;

    public Response getCity(String params) {
        Map<String, String> map = JSON.parseObject(params, Map.class);
        City city = new City();
        city.setProvinceId(map.get("province_id"));
        List<City> cities = cityDao.select(city);
        Response response = new Response();
        response.setResult(JSON.toJSONString(cities));
        return response;
    }

}
